package vip.web3.common.enums;


public enum StatusEnum {

    OPEN(1, "开启", "上架", "有效"),
    OFF(0, "关闭", "下架", "失效"),
    ;

    private Integer code;
    private String switchRemark;
    private String saleableRemark;
    private String validRemark;

    StatusEnum(Integer code, String switchRemark, String saleableRemark, String validRemark) {
        this.code = code;
        this.switchRemark = switchRemark;
        this.saleableRemark = saleableRemark;
        this.validRemark = validRemark;
    }

    public static StatusEnum getEnum(Integer code) {
        StatusEnum[] values = values();
        for (StatusEnum e : values) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getSwitchRemark() {
        return switchRemark;
    }

    public String getSaleableRemark() {
        return saleableRemark;
    }

    public String getValidableRemark() {
        return validRemark;
    }
}
